﻿using UnityEngine;
using System.Collections;

public class Shell : MonoBehaviour {

	public GameObject shellExplosion;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	public void OnTriggerEnter(Collider collider){
		GameObject.Instantiate (shellExplosion, this.transform.position, this.transform.rotation);

		GameObject.Destroy (this.gameObject);

		//炸弹碰到坦克
		if (collider.tag == "Tank") {
			collider.SendMessage("TakeDamage");
		}

	}
}
